// 导入 express 模块
const express = require("express");
const cors = require("cors");
const getDataMiddleWare = require("./middleware");

// 定义端口号
const PORT = 9898;

// 创建 express 应用
const app = express();

app.use(cors()); //解决跨域

app.get("*", getDataMiddleWare);
app.post("*", getDataMiddleWare);

// 启动服务器
app.listen(PORT, () => {
  console.log(`Server is running on http://localhost:${PORT}`);
});
